<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\common\validate;

/**
 * Description of LoginValidate
 *
 * @author DevPHP
 */
class LoginValidate extends \think\Validate {

    protected $batch = true;
    protected $rule = [
        'user_name' => 'require|max:25',
        'age' => 'number|between:1,120',
        'email' => 'email',
    ];
    protected $message = [
        'name.require' => '名称必须',
        'name.max' => '名称最多不能超过25个字符',
        'age.number' => '年龄必须是数字',
        'age.between' => '年龄只能在1-120之间',
        'email' => '邮箱格式错误',
    ];
    
    protected $scene = [
        'login_with_password'  =>  ['user_name','password'],
        'login_with_sms'  =>  ['mobile','sms_code'],
    ];

}
